import request from "@/utils/request";
import ConstTable from './ConstTable'

const api = {
    // 根据ID获取
    getInfo(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/${id}`,
            method: "get"
        });
    },
    getMaterialInfo(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/GetMaterialInfo/${id}`,
            method: "get"
        });
    },
    getDetailInfo(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/GetDetailInfo/${id}`,
            method: "get"
        });
    },
    // 查询信息
    getList(query)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute`,
            method: "GET",
            data: query
        });
    },
    getStationAlldata()
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/GetDetailStationInfo`,
            method: "get"
        });
    },
    // 创建
    create(dataForm)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute`,
            method: "post",
            data: dataForm
        });
    },
    // 更新
    update(dataForm)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/${dataForm.id}`,
            method: "PUT",
            data: dataForm
        });
    },
    // 删除
    delete(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/${id}`,
            method: "DELETE"
        });
    },
    // 根据ID批量删除
    batchDelete(ids)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/batchRemove`,
            method: "POST",
            data: ids
        });
    },
    // 根据查询条件导出数据
    export(query)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Artroute/Actions/Export`,
            method: "GET",
            data: query
        });
    }
};

export default api;

export const getDefactAll = api.getAll;
